import request from '@/utils/request.js'

//获取渲染列表数据
export const getRoleAllApi = () => {
    return request ({
        url:'/auth/role',
        method:'get'
    })
}

//获取数详情
export const getRoleListApi = (params) => {
    return request ({
        url:'/auth/role',
        method:'get',
        params
    })
}

//新增
export const addRoleList = (data) => {
    return request ({
        url:'/auth/role',
        method:'post',
        data
    })
}
// 获取权限列表
export const getMenuListApi = () => {
    return request({
      url: "/auth/menu",
      method: "get",
    });
  };

// 角色列表
export function roleListApi(params) {
    return request({
      url: "/auth/role",
      method: "get",
      params,
    });
  }

// 获取角色详情
export const getRoleApi = (id) => request({
  url: '/auth/role/' + id
})

// 修改角色
export const editRoleApi = (data) => request({
  url: '/auth/role/' + data.id,
  method: 'put',
  data
})

// 删除角色
export const delRoleApi = (id) => request({
  url: '/auth/role/' + id,
  method: 'delete',
})